<template>
  <div id="ruifox-admin">
    <router-view />
  </div>
</template>

<script setup>
import { onBeforeMount } from 'vue'
import { useStore } from 'vuex'
import { scrollEvent } from '@/utils/scrollevent'

const store = useStore()

onBeforeMount(async () => {
  await store.dispatch('user/login')
  const { iconInit } = await import('@ruifox-cms/utils')
  const res = await store.dispatch('base/getGroupSetting')
  await store.dispatch('site/updateSiteGroup')
  await store.dispatch('category/updateCategory')
  iconInit(res.publicIcon)
  iconInit(res.projectIcon)
  scrollEvent()
})
</script>

<style lang="scss">
#app {
  width: 100vw;
  height: 100vh;
  overflow-y: hidden;
}
</style>
